<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<meta name="Generator" content="EditPlus®">
		<meta name="Author" content="梦想星辰大海">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<title>cms后台模板</title>
		<link rel="stylesheet" href="${BASE_PATH}/static/book/res/lib/layui/css/layui.css">
	</head>

	<body>
		<form id="ff" method="post">
			<input id="txt-p" type="hidden" name="p" value="${pageVo.pageNum}"/>
			<div class="layui-form-item">
		    	<div class="layui-inline">
		     		<label class="layui-form-label">图书编号</label>
	      			<div class="layui-input-block">
		        		<input type="text" name="number" value="${searchVo.number}" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
	      			</div>
	    		</div>
		    	<div class="layui-inline">
			      	<label class="layui-form-label">书名</label>
			      	<div class="layui-input-inline">
			        	<input type="text" name="name" value="${searchVo.name}" autocomplete="off" class="layui-input">
			      	</div>
		    	</div>
		    	<div class="layui-inline">
			      	<label class="layui-form-label">作者</label>
			      	<div class="layui-input-inline">
			        	<input type="text" name="author" value="${searchVo.author}" autocomplete="off" class="layui-input">
			      	</div>
		    	</div>
		    	<div class="layui-inline">
			      	<label class="layui-form-label">出版社</label>
			      	<div class="layui-input-inline">
			        	<input type="text" name="press" value="${searchVo.press}" autocomplete="off" class="layui-input">
			      	</div>
		    	</div>
		    	<div class="layui-inline">
			      	<button class="layui-btn">确认</button>
			 	</div>
		 	</div>
		</form>  
		<div class="layui-btn-group">
			<a id="btn-add" href="#" class="layui-btn">增加</a>
		</div>
		<div class="layui-form">
			<table class="layui-table" lay-skin="line">
				<colgroup>
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="200">
					<col width="200">
					<col width="150">
					<col width="120">
					<col width="80">
					<col width="200">
					<col>
				</colgroup>
				<thead>
					<tr>
						<th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
						<th>图书分类</th>
						<th>图书编号</th>
						<th>图片</th>
						<th>书名</th>
						<th>作者</th>
						<th>出版社</th>
						<th>在馆数量</th>
						<th>总数量</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					[#list pageVo.list as book]
					<tr>
						<td><input type="checkbox" name="" lay-skin="primary"></td>
						<td>${book.cateId}</td>
						<td>${book.number}</td>
						<td>${book.urlPic}</td>
						<td>${book.name}</td>
						<td>${book.author}</td>
						<td>${book.press}</td>
						<td>${book.librarieNumber}</td>
						<td>${book.totalQuantity}</td>
						<td>
							<a href="editPage.htm?id=${book.bookId}" style="color: #707070;margin-right: 5px;">
								<i class="icon iconfont icon-bianji " style="color: #707070; "></i>编辑
							</a>
							<a href="${BASE_PATH}/book/admin/book/editQuantityPage.htm?id=${book.bookId}" style="color: #707070; ">
								<i class="icon iconfont icon-iconfonticonfontclose " style="color: #707070;font-size: 18px; "></i>出入库
							</a>
				  		</td>
		    		</tr>
		    		[/#list]
		  		</tbody>
			</table> 
  		</div>
	  	<div id="demo1"></div>
	</body>
	<script type="text/javascript " src="${BASE_PATH}/static/book/res/lib/layui/layui.js"></script>
	<script>
	layui.use(['laypage', 'layer', 'form'], function() {
		var $ = layui.jquery,
			form = layui.form();
		var laypage = layui.laypage,
			layer = layui.layer;
		$("#btn-add ").on("click ", function() {
			window.parent.tabAdd(111, "添加 ", "${BASE_PATH}/book/admin/book/addPage.htm");
		});

		//全选
		form.on('checkbox(allChoose)', function(data) {
			var child = $(data.elem).parents('table').find('tbody input[type="checkbox "]');
			child.each(function(index, item) {
				item.checked = data.elem.checked;
			});
			form.render('checkbox');
		});

		//分页
		laypage({
			cont: 'demo1'
			,pages: ${pageVo.pageCount} //总页数
			,curr: ${pageVo.pageNum}
			,groups: 5 //连续显示分页数
			,jump: function(obj, first) {
				if(first===true){
					return ;
				}
				var curr = obj.curr;
				console.dir(curr);
				$("#txt-p").val(curr);
				//得到了当前页，用于向服务端请求对应数据
				$("#ff").submit();
				
			}
		});

	});
</script>

</html>